import 'package:flutter/material.dart';

class RoomPriceItemWidget extends StatelessWidget {

final String label;
  final Widget Function(BuildContext context) contentBuilder;

  final Widget suffix;
  final String suffixText;

  final String hintText;
  final ValueChanged onChanged;
  final TextEditingController controller;

  const RoomPriceItemWidget(
      {Key key,
      this.label,
      this.contentBuilder,
      this.suffix,
      this.suffixText,
      this.hintText,
      this.onChanged,
      this.controller})
      : super(key: key);

  Widget _titleView() {
    return Container(
      padding: EdgeInsets.only(left: 10,right: 10),
      height: 49,
      child: Row(children: <Widget>[
        Container(child: Text(label),padding: EdgeInsets.only(right: 80),),
        Expanded(child: TextField(
          decoration: InputDecoration(
            hintText: hintText,
            border: InputBorder.none,
          ),
        )),
        Container(child: Text(suffixText),)

      ],),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: 14,right: 14),
      decoration: BoxDecoration(border: Border(
        bottom: BorderSide(
          width: 1,color: Colors.black12
        )
      )),
      child: Row(
        children: <Widget>[
          Container(width: 100,child: Text(label,style: TextStyle(fontSize: 16),),),
          contentBuilder!=null?contentBuilder(context):
          Expanded(child: TextField(
            controller: controller,
            decoration: InputDecoration(
              border: InputBorder.none,
              hintText: hintText
            ),
          )),
          if(suffix!=null)suffix,
          if(suffix==null&&suffixText!=null)Text(suffixText)
        ],
      ),
    );
  }
}
